package com.crm.dao;


import org.hibernate.Criteria;
import org.hibernate.criterion.Restrictions;

import com.crm.dao.core.BaseDao;
import com.crm.pojo.Org;
import com.crm.pojo.OrgName;
import com.crm.pojo.User;

public class UserDao extends BaseDao<User, String> {
	public void regit(User user, OrgName orgName, Org org) {
		getSession().save(user);
		getSession().save(orgName);
		getSession().save(org);
		
	}

	public User getUserByEmail(String email) {
		Criteria cri = getSession().createCriteria(User.class);
		cri.add(Restrictions.eq("email", email));
		return (User) cri.uniqueResult();
	}
}
